<template>
  <div>
    <h1>干</h1>
    <p><input type="text" v-model="username"></p>
    <button @click="sq">确定授权</button>
  </div>
</template>

<script>
export default {
  name: "sanfang",
  data() {
    return {
      username: '',
      uid: localStorage.getItem('uid'),
      token: localStorage.getItem('ltoken')
    }
  },
  methods: {
    sq() {
      this.$axios.post('/login/dengluM', {
        'username': this.username,
        'token': this.token,
        'uid': this.uid
      }).then(res => {
        if (res.data.code == 200) {
          alert(res.data.mes)
          localStorage.setItem('userid', res.data.userid)
          window.location.href = res.data.url
        } else {
          alert('no')
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
